package com.designed.pattern.addition.strategyfactoryDecorate;

/**
 * @author yifei
 * @description strategy
 * @date 2024/1/2
 **/
public class CashSuper implements ISale {
    protected ISale component;

    public void decorate(ISale iSale) {
        this.component = iSale;
    }

    public double acceptCash(double price, int num) {
        double result = 0d;
        if (this.component != null) {
            result = this.component.acceptCash(price, num);
        }
        return result;
    }
}
